home *** CD-ROM | disk | FTP | other *** search
- Path: airdmhor.gen.nz!not-for-mail
- From: gumboot@airdmhor.gen.nz (Simon Hosie)
- Newsgroups: comp.lang.c
- Subject: Re: division problem
- Date: 29 Jan 1996 12:50:30 +1300
- Organization: Airdmhor
- Distribution: world
- Message-ID: <4eh246$u6h@airdmhor.gen.nz>
- References: <31097D77.11AA@rain.org> <26JAN199622082450@erich.triumf.ca>
- NNTP-Posting-Host: localhost.gen.nz
- X-Newsreader: TIN [version 1.2 PL2]
-
- P.Bennett:
- > In order to make it work, you could do:
- > celsius = (int)((5.0/9.0) * (fahrenheit - 32))
- > The 5.0/9.0 give a meaningful result, and force the multiplication to be done
- > with floats. The (int) will convert the result back to an int.
-
- That's disgusting!
-
- celcius = (fahrenheit - 32) * 5 / 9;
-